home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.sources.wanted,comp.lang.c,comp.unix.programmer
- Subject: Re: Seek unix2dos.c OR help with tr
- Date: 14 Mar 1996 14:47:15 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4ia0kj$d8s@solutions.solon.com>
- References: <4i0946$7io@nuke.csu.net> <danpop.826545577@rscernix> <4i9dj4INN7kl@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4i9dj4INN7kl@keats.ugrad.cs.ubc.ca>,
- Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
- >When I know that I'm specifically dealing with ASCII control chars, I have a
- >macro like:
-
- >#define CTRL(C) ((C)-64)
-
- >which I then use with capital letters:
-
- > switch(char) {
- > case CTRL('M'):
-
- I always use
- #define CTRL(x) ((x) & 0x1f)
-
- because this preserves the likely semantics of CTRL.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-